// stores/auth.js  
import { defineStore } from 'pinia';  
  
export const useAuthStore = defineStore('auth', {  
  state: () => ({  
    isLoggedIn: false,  
    user: null,  
  }),  
  actions: {  
    login(user) {  
      // 这里应该是调用API来验证用户信息，并获取token等  
      // 假设验证成功，则设置登录状态  
      this.isLoggedIn = true;  
      this.user = user;  
    },  
    logout() {  
      // 登出逻辑，清除状态  
      this.isLoggedIn = false;  
      this.user = null;  
    },  
  },  
});